// 子模块moduleA路径：store/modules/moduleA.js 
export default {
	state: {
		userInfo:'',
		token:'',
		isStatus:false
	},
	mutations: {
		//存储token
		setToken( state ,token ){
			state.token = token;
		},
		//存储用户信息
		setUserInfo( state, userInfo ){
			state.isStatus = true;
			state.userInfo = userInfo;
		},
		//退出登录
		loginOut( state ){
			state.isStatus = false;
			state.userInfo = {};
			state.token = '';
		}
	},
	actions: { 
		userLogin( {commit} , data ){
			if( data ){
				var { token , user } = data;
			}
			commit('setToken' , token );
			commit('setUserInfo' , user );
		}
	},
	getters: {
		
	},
}